import {dialog} from 'electron';
export const CANCELED = "CANCELED"
export const callFileSelect = (fileTypes: Electron.FileFilter[])=>{
    return new Promise<string>((resolve,reject)=>{
        dialog.showOpenDialog({
            title: '选择视频文件',
            properties: ['openFile'],
            filters: fileTypes
        }).then(result=>{
            if(!result.canceled){
                resolve(result.filePaths[0]);
            }else{
                resolve("CANCELED");
            }
        }).catch(err=>{
            reject(err);
        })
    })
}
